<!DOCTYPE html>
<html>
${r'<#assign title="${table.remarks}">'}
${r'<#include "/util/head.ftl">'}
<body>
	<style type="text/css">
	.t_lable{text-align:right;background-color: #F8F8F8}
	.t_content{text-align:left}
	</style>
	<div class="layui-fluid">
		<div class="layui-row">
			<form class="layui-form" id="table_form" action="">
			<input type="hidden" name="id" value="${r'${'}param.id!''${r'}'}">
			<input type="hidden" name="delflag" value="${r'${'}param.delflag!''${r'}'}">
			<table class="layui-table" lay-size="sm">
			  <colgroup>
			    <col width="15%">
			    <col width="35%">
			    <col width="15%">
			    <col width="35%">
			  </colgroup>
			  <tbody>
			  	<#list table.entityColumns as column>
			  	<#if !column?is_even_item>
			  	<tr>
			  	</#if>
			  	  <td class="t_lable">${column.remarks}</td>
			      <td class="t_content">
			      <#if column.formElementType=='textarea'>
			      	<textarea name="${column.javaName}" value="${r'${'}param.${column.javaName}!''${r'}'}" lay-verify="${column.verify}" placeholder="请输入内容" class="layui-textarea"></textarea>
			      <#elseif column.formElementType=='select'>
			      	<select id="${column.javaName}" name="${column.javaName}" value="${r'${'}param.${column.javaName}!''${r'}'}" lay-verify="${column.verify}" lay-search>
			        	<option value="">请选择</option>
			     	</select>
			     	<script>$("${r'#'}${column.javaName}").val('${r'${'}param.${column.javaName}!''${r'}'}')</script>
			      <#elseif column.formElementType=='date'>
			      	<input type="text" id="${column.javaName}" name="${column.javaName}" value="${r'${'}param.${column.javaName}!''${r'}'}" lay-verify="${column.verify}" class="layui-input">
			      	<script type="text/javascript">
			      		layui.laydate.render({elem: '${r'#'}${column.javaName}'});
			      	</script>
			      <#elseif column.formElementType=='image'>
			      	${r'<@upload.singleImage'} name="${column.javaName}" value="${r'${'}param.${column.javaName}!''${r'}'}"/>
			      <#elseif column.formElementType=='file'>
			      <#else>
			      	<input type="text" name="${column.javaName}" value="${r'${'}param.${column.javaName}!''${r'}'}" lay-verify="${column.verify}" class="layui-input">
			      </#if>
			      </td>
			    <#if column?is_even_item || !column?is_even_item && !column?has_next>
			  	</tr>
			  	</#if>
				</#list>
			  </tbody>
			</table>
			${r'<#if !viewMode??>'}
			<hr>
			<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="*" style="float: right">
				<i class="layui-icon">&#xe618;</i>保存
			</button>
			${r'</#if>'}
			<br>
			<br>
			<br>
			</form>
		</div>
	</div>
</body>
<script type="text/javascript">
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	var postUrl="/${table.module?uncap_first}/${table.javaName?uncap_first}/save.json";
	
	$(function(){
		${r'<#if viewMode??>'}
		${r'$'}('input').attr("readonly","readonly");
		${r'$'}('select').attr("disabled","disabled");
		${r'$'}('textarea').attr("readonly","readonly");
		${r'$'}('button').attr("disabled","disabled");
		${r'$'}("button").addClass("layui-btn-disabled");
		${r'</#if>'}
		layui.form.render();
	});
	
	layui.form.on('submit(*)', function(formData) {
		postData(postUrl);
		return false;
	});
</script>
</html>